﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace Opds_Viewer.Converter
{
    [ValueConversion(typeof(string),typeof(string))]
    class CommentBookConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var oriText = value.ToString();

            // Remove all the html tags from the comment
            return System.Text.RegularExpressions.Regex.Replace(oriText, "(<[^>]+>)", "");
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
